package item.inkcloud.distributionservice.controller;


import item.inkcloud.distributionservice.service.ChangeUserCountService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;



@RestController

public class ChangeUserCountController {

    @Autowired
    ChangeUserCountService changeUserCountService;


    @RequestMapping("/addProvinceCount")
    int addCount(@RequestParam("province") String province){
        int status = changeUserCountService.addUserCount(province);
        return status;
    }


    @RequestMapping("/exchangeProvince")
    int exchangeProvince(@RequestParam("oldProvince") String oldProvince,@RequestParam("newProvince") String newProvince){

        int status = changeUserCountService.exchangeProvince(oldProvince,newProvince);

        return status;


    }


}
